package test.y2019.november;

import cn.hutool.core.lang.Console;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import static java.util.Comparator.comparingInt;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2019/11/8 16:51
 */
public class November2 {

    public static void main(String[] args) {

        List<Integer> strings = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8);

        List<Integer> collect = strings.stream().filter(i -> 2 == i).collect(Collectors.toList());

        Integer integer = strings.stream().max(comparingInt(i -> i)).get();

        Console.error(collect);
        Console.error(integer);

    }
}
